package com.smartsaas.ugclivii.handler;

import com.smartsaas.ugclivii.job.JobUtils;
import com.smartsaas.ugclivii.ui.UiContext;
import nxopen.NXException;
import nxopen.blockstyler.BlockDialog;
import java.rmi.RemoteException;


public class DialogShownImpl implements BlockDialog.DialogShown {
    @Override
    public void dialogShown() throws NXException, RemoteException {
        UiContext instance = UiContext.getInstance();
        int i = instance.getExplorer().currentNode();
        try {
            JobUtils.jobTreeInitColumn();
            if (i==1){
                JobUtils.loadBody();
                JobUtils.designTreeInitColumn();
                JobUtils.doJob("加载图层", JobUtils::loadLayer);
            }
            //模料管理
            if (i==2){
                JobUtils.mlTreeInitColumn();
            }
            //BOM管理
            if (i==3){
                JobUtils.bomTreeInitColumn();
            }
            //电极管理
            if (i==4){
                JobUtils.eleTreeInitColumn();
            }
        }catch (Exception e) {
            instance.debug(e);
        }
    }
}
